Skip to content

load_aware_locality: implement lb policy#45725

Open
jukie wants to merge 9 commits into
envoyproxy:mainfrom
jukie:load-aware-lb-impl
Open

load_aware_locality: implement lb policy#45725
jukie wants to merge 9 commits into
envoyproxy:mainfrom
jukie:load-aware-lb-impl

Conversation

@jukie

@jukie jukie commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Commit Message: load_aware_locality: implement ORCA utilization-based locality picking

Additional Description:
Implements the envoy.load_balancing_policies.load_aware_locality extension added in #44341 which is a locality-picking LB policy that weights localities by backend utilization aggregated from ORCA load reports.

Some notes:

Risk Level: low/medium - opt-in extension that is still work-in-progress
Testing: Added unit and integration tests, also verified in a real environment.
Docs Changes: Un-orphaned docs/root/intro/arch_overview/upstream/load_balancing/load_aware_locality.rst which will now be rendered in site docs
Release Notes: Added
Platform Specific Features: N/A
Fixes #43665

AI disclosure: portions of this PR and it’s tests were developed with LLM but I have reviewed and understand the code

@repokitteh-read-only

Copy link
Copy Markdown

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #45725 was opened by jukie.

see: more, trace.

@jukie

jukie commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

/coverage

@repokitteh-read-only

Copy link
Copy Markdown

Coverage for this Pull Request will be rendered here:

https://storage.googleapis.com/envoy-cncf-pr/45725/coverage/index.html

For comparison, current coverage on main branch is here:

https://storage.googleapis.com/envoy-cncf-postsubmit/main/coverage/index.html

The coverage results are (re-)rendered each time the CI Envoy/Checks (coverage) job completes.

🐱

Caused by: a #45725 (comment) was created by @jukie.

see: more, trace.

@jukie
jukie force-pushed the load-aware-lb-impl branch 2 times, most recently from ac7a860 to 2f0a702 Compare June 25, 2026 06:22
@jukie
jukie force-pushed the load-aware-lb-impl branch 2 times, most recently from 6221cab to 8acb258 Compare July 5, 2026 23:44
@jukie

jukie commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

/coverage

@repokitteh-read-only

Copy link
Copy Markdown

Coverage for this Pull Request will be rendered here:

https://storage.googleapis.com/envoy-cncf-pr/45725/coverage/index.html

For comparison, current coverage on main branch is here:

https://storage.googleapis.com/envoy-cncf-postsubmit/main/coverage/index.html

The coverage results are (re-)rendered each time the CI Envoy/Checks (coverage) job completes.

🐱

Caused by: a #45725 (comment) was created by @jukie.

see: more, trace.

@jukie jukie changed the title lb-policies: Implement LoadAwareLocality Lb load_aware_locality: implement lb policy Jul 6, 2026
Comment thread source/extensions/load_balancing_policies/load_aware_locality/config.cc Outdated
@jukie

jukie commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements the envoy.load_balancing_policies.load_aware_locality load balancer policy, which weights localities based on ORCA-derived utilization headroom and supports in-band ORCA reporting across all priority levels. The changes include configuration parsing, main-thread and worker-local load balancing logic, and comprehensive unit, configuration, and integration tests. Feedback on the pull request points out that the integration test target in the BUILD file should list the envoy.load_balancing_policies.round_robin extension in its extension_names attribute, as it is instantiated during the integration test.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread test/extensions/load_balancing_policies/load_aware_locality/BUILD Outdated
@jukie
jukie force-pushed the load-aware-lb-impl branch from fb02adb to 68310e2 Compare July 16, 2026 00:56
@jukie

jukie commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements the load_aware_locality load balancer policy, which weights localities by ORCA-derived utilization headroom, consumes in-band ORCA reporting, and applies at all priority levels. The implementation includes the main-thread LoadAwareLocalityLoadBalancer for computing locality routing weights and publishing snapshots, and the worker-thread WorkerLocalLb for delegating endpoint selection to child load balancers. Comprehensive unit, configuration, and integration tests have been added to verify the functionality. There are no review comments to address, so no additional feedback is provided.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

jukie added 8 commits July 15, 2026 19:39
Introduce the load-aware locality LB extension: typed config, factory
registration, per-endpoint metadata, and the LoadAwareLocalityLbConfig
that carries tuning knobs to the balancer.

Signed-off-by: jukie <10012479+jukie@users.noreply.github.com>
Add LocalityLbHostData: workers store per-host utilization from ORCA
load reports with release/acquire publication for the main thread.

Signed-off-by: jukie <10012479+jukie@users.noreply.github.com>
Add the per-priority routing-weights snapshot types and the worker LB
factory that publishes snapshots to workers via thread-local storage.

Signed-off-by: jukie <10012479+jukie@users.noreply.github.com>
Add WorkerLocalLb: live priority/health/panic selection on workers, then
index-aligned locality choice delegating to a per-locality child LB.

Signed-off-by: jukie <10012479+jukie@users.noreply.github.com>
Add the main-thread balancer that periodically computes EWMA-smoothed
locality weights from host utilization and publishes routing snapshots.

Signed-off-by: jukie <10012479+jukie@users.noreply.github.com>
Unit coverage for config parsing and the balancer's weight computation,
locality selection, and host-sync paths.

Signed-off-by: jukie <10012479+jukie@users.noreply.github.com>
End-to-end integration coverage for the load-aware locality policy.

Signed-off-by: jukie <10012479+jukie@users.noreply.github.com>
Document the policy's design and add the changelog entry.

Signed-off-by: jukie <10012479+jukie@users.noreply.github.com>
@jukie
jukie force-pushed the load-aware-lb-impl branch from 68310e2 to 9184e60 Compare July 16, 2026 04:27
Comment on lines +400 to +405
- **Out-of-band ORCA reporting is not yet supported.** Only in-band
(per-response) ORCA reports are consumed. ``enable_oob_load_report`` and
``oob_reporting_period`` are accepted but currently have no effect.
- **Probing is required.** A locality only produces fresh ORCA samples
when it receives traffic, so ``remote_probe_fraction`` must stay above 0
to keep remote localities reporting. Set it to 0 only when cross-zone

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depends on #45953 as noted in PR description. Once that's merged I'll wire OOB into this policy and update the docs again.

@jukie
jukie marked this pull request as ready for review July 16, 2026 05:40
@jukie
jukie requested review from nezdolik and tonya11en as code owners July 16, 2026 05:40
@nezdolik nezdolik self-assigned this Jul 16, 2026
Signed-off-by: jukie <10012479+jukie@users.noreply.github.com>
@jukie

jukie commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

/retest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proposal: ORCA-driven locality routing for zone-aware load balancing

2 participants